package edu.lnu.ums.init;

import javax.ejb.EJB;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import edu.lnu.ums.service.IDBInitService;


public class DatabaseInitializer implements ServletContextListener {
    
    @EJB(mappedName="UMS/DBInitService/local")
    IDBInitService initBean;
    
    @Override
    public void contextDestroyed(ServletContextEvent arg0) {        
        
    }

    @Override
    public void contextInitialized(ServletContextEvent arg0) {    
        initBean.initializeAppAndDefaultDB();
    }

}
